package com.automannn.atm_back.config;

import com.automannn.atm_back.common.util.SmsHelper;
import com.automannn.atm_back.modules.message.handle.impl.EmailSendMsgHandle;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author chenkh
 * @time 2020/6/25 15:27
 */
@Configuration
public class StaticConfig {
    @Value("${atm_back.sms.accessKeyId}")
    private String accessKeyId;

    @Value("${atm_back.sms.accessKeySecret}")
    private String accessKeySecret;

    @Value(value = "${spring.mail.username}")
    private String emailFrom;


    @Bean
    public void initStatic() {
        SmsHelper.setAccessKeyId(accessKeyId);
        SmsHelper.setAccessKeySecret(accessKeySecret);
        EmailSendMsgHandle.setEmailFrom(emailFrom);
    }

}
